package com.ruoyi.platform.system.user.pojo;

import com.ruoyi.base.utils.oss.OssUtils;
import com.ruoyi.platform.system.user.pojo.UserDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户信息表
 *
 * @author lcf
 * @version 0.0.1
 * @since 2020-11-13 05:40:22
 */
@ApiModel
@Data
@NoArgsConstructor
public class UserEditQuery {
    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "用户昵称", required = true)
    private String nickName;
    /**
     * 手机号码
     */
    @ApiModelProperty(value = "手机号码")
    private String phone;
    /**
     * 头像
     */
    @ApiModelProperty("头像")
    private String headImg;

    /**
     * 新增
     */
    public UserDO convert(long userId) {
        UserDO user = new UserDO();
        user.setUserId(userId);
        user.setNickName(this.nickName);
        user.setPhone(this.phone);
        user.setHeadImg(OssUtils.getRelativeUrl(this.headImg));
        return user;
    }
}
